﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YuanLiao_DaoHuo_Pick.aspx.cs" Inherits="syc.Store.YuanLiao_DaoHuo_Pick" %>
<html>
<body>
    <script type="text/javascript" language="javascript" src="/common.js"></script>
     <form id="form2" runat="server">
    <div id="wintop" class="wintop">合格原料入库</div>
    <asp:Panel ID="Panel1" runat="server" CssClass="panel">

        <asp:Button ID="Button_Save" runat="server" Text="下一步" CssClass="button" 
                 UseSubmitBehavior="False" onclick="Button_Save_Click" />
        <asp:Button ID="Button_Back" runat="server" Text="返 回" CssClass="button" 
                 UseSubmitBehavior="False" onclick="Button_Back_Click"  Visible="false" />
</asp:Panel>

     <asp:Panel ID="Panel3" runat="server" CssClass="panel2" Visible="false">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    
    
    <asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="到货单查询">
        供货单位：<asp:DropDownList ID="GongHuoDanWei" runat="server" 
            DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID">
        </asp:DropDownList>
        
        原材料：<asp:DropDownList ID="YuanCaiLiao" runat="server" 
            DataSourceID="SqlDataSource3" DataTextField="品名" DataValueField="ID">
        </asp:DropDownList>
        开始日期：<asp:TextBox ID="Date1" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
        结束日期：<asp:TextBox ID="Date2" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
        <asp:Button ID="Button_Query" runat="server" CssClass="wsbutton" 
            onclick="Button_Query_Click" Text="查 询" UseSubmitBehavior="true" />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT [ID], [名称] FROM [原料供货单位]">
        </asp:SqlDataSource>        
    </asp:Panel>
     <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT [ID], [品名] FROM [原料]">
        </asp:SqlDataSource>

    <div class="gridframe">
        <div class="gridview">
        
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title">合格原料</td>
		        </tr>
		        <tr>
		            <td class="grid-back"  height="100">
                        <asp:SqlDataSource  ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>">
                            </asp:SqlDataSource>
                         <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                             AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            DataSourceID="SqlDataSource1" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False" >
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <SelectedRowStyle   CssClass="grid-row-bright" />
                            <Columns>
                                <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                        <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="ID" SortExpression="ID" Visible="false">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="40px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="原料类别" SortExpression="原料类别">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("原料类别") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="left" Width="160px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="车号" SortExpression="车号">
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("车号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="供货单位" SortExpression="供货单位">
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("供货单位") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="left" Width="120px" />
                                </asp:TemplateField>            
   
                                <asp:TemplateField HeaderText="到货日期" SortExpression="到货日期">
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("到货日期","{0:D}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>   
                          
                                <asp:TemplateField HeaderText="磅量" SortExpression="磅量">
                                    <ItemTemplate>
                                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("磅量") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="right" Width="80px" />
                                </asp:TemplateField>  
 
                                <asp:TemplateField HeaderText="入库状态">
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='未入库'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />
                                </asp:TemplateField> 
                              
                                <asp:TemplateField HeaderText="质检结果">
                                    <ItemTemplate>
                                        <asp:Label ID="Label7" runat="server" Text='合格'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />
                                </asp:TemplateField> 
                          
                                <asp:TemplateField HeaderText="操作" ShowHeader="true" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="Button_Pick" runat="server" CommandName='<%# Eval("ID") %>' 
                                            Text="选取" onclick="Button_Pick_Click" CssClass="smallbutton" />

                                    </ItemTemplate>
                                </asp:TemplateField>
                          
                          
         
                          
                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                 <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        <asp:SqlDataSource  ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>">
            </asp:SqlDataSource>

        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title">已选取：</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                         <asp:GridView ID="GridView2" runat="server" 
                             AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            DataSourceID="SqlDataSource4" 
                            GridLines="None"
                            UseAccessibleHeader="False">
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <SelectedRowStyle   CssClass="grid-row-bright" />
                            <Columns>
                                <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                        <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="ID" SortExpression="ID" Visible="false">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="40px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="原料类别" SortExpression="原料类别">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("原料类别") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="left" Width="160px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="车号" SortExpression="车号">
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("车号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="供货单位" SortExpression="供货单位">
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("供货单位") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="left" Width="120px" />
                                </asp:TemplateField>            
   
                                <asp:TemplateField HeaderText="到货日期" SortExpression="到货日期">
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("到货日期","{0:D}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                                </asp:TemplateField>   
                          
                                <asp:TemplateField HeaderText="磅量" SortExpression="磅量">
                                    <ItemTemplate>
                                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("磅量") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="right" Width="80px" />
                                </asp:TemplateField>  
 
                                <asp:TemplateField HeaderText="入库状态">
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='未入库'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />
                                </asp:TemplateField> 
                              
                                <asp:TemplateField HeaderText="质检结果">
                                    <ItemTemplate>
                                        <asp:Label ID="Label7" runat="server" Text='合格'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />
                                </asp:TemplateField> 
                          
                                <asp:TemplateField HeaderText="操作" ShowHeader="true" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="Button_Unselect" runat="server" CommandName='<%# Eval("ID") %>' 
                                            Text="取消" onclick="Button_Unselect_Click" CssClass="smallbutton" />

                                    </ItemTemplate>
                                </asp:TemplateField> 
                          
                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
            </table>

        </div>
    </div>
    
    
    
    
    </form>
<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = function() { this.firstChild.firstChild.click(); };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }
</script>
</body>
</html>
